# Contributor: Adam Plumb <adamplumb@gmail.com>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=libadwaita
pkgver=1.4.2
pkgrel=0
pkgdesc="Building blocks for modern GNOME applications"
url="https://gitlab.gnome.org/GNOME/libadwaita"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	appstream-dev
	fribidi-dev
	glib-dev
	gobject-introspection-dev
	gtk4.0-dev
	meson
	sassc
	vala
	"
# Tests need any font
checkdepends="
	dbus
	font-dejavu
	mesa-dri-gallium
	xvfb-run
	"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-lang $pkgname-demo"
source="https://gitlab.gnome.org/GNOME/libadwaita/-/archive/$pkgver/libadwaita-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -g1" \
	CPPFLAGS="$CPPFLAGS -g1" \
	abuild-meson \
		-Db_lto=true \
		-Dexamples=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
	dbus-run-session -- \
	xvfb-run -a \
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

demo() {
	pkgdesc="$pkgdesc (libadwaita demo)"
	amove usr/share usr/bin
}

sha512sums="
c16c5916fadf38b85d8f4edf6a788a68c21fb4b89ca36599ec159f00526e4bd24220eff127c76b3be934f5b0166e75155a58b999081b2b09b5ae0bf2ca039fb9  libadwaita-1.4.2.tar.gz
"
